import type { HtmlElementOrComponent, NullableAsComponentProps, RefComponent } from "@lib/types";
import { Tooltip } from "bootstrap";
import type { JSXElement } from "solid-js";

export interface InnerTooltipProps<T extends HtmlElementOrComponent> extends RefComponent<Tooltip> {
    as?: T,
    options?: Partial<Tooltip.Options>
    children?: JSXElement
    title?: JSXElement
}

export type TooltipProps<T extends HtmlElementOrComponent = 'span'> = Omit<(T extends undefined ? {} : NullableAsComponentProps<T>), 'title'> & InnerTooltipProps<T>;

